﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DapperExtensions.Mapper;
using Newtonsoft.Json;
using ZilLion.Service.Core.Domain.EntityBase.JsonConverter;
using ZilLion.Service.Core.ModelBase;

namespace ZL.CRM.CommonEntity.AccYwDetail
{
    public class AccStaChangeEach
    {

        /// <summary>
        ///  申请时间
        /// </summary>
        [JsonConverter(typeof(ChinaDateTimeConverter))]
        public DateTime Oprtime { get; set; }

        /// <summary>
        ///  操作记录流水号
        /// </summary>
        public string Oprsno { get; set; }

        /// <summary>
        ///  账户id
        /// </summary>
        public long Opraccid { get; set; }

        /// <summary>
        ///  添加凭证号
        /// </summary>
        public string Oprcardno { get; set; }

        /// <summary>
        ///  操作类型：1-实体卡卡号 2-微信accid+'|'+openid 4-手机号 5-动态凭证号 6-微信membershipno
        /// </summary>
        public short Oprctype { get; set; }

        /// <summary>
        ///  变更前：折扣类别id
        /// </summary>
        public int Oprbefdisid { get; set; }

        /// <summary>
        ///  变更前：折扣类别识别码
        /// </summary>
        public string Oprbefdissbm { get; set; }


        /// <summary>
        ///  变更掐前：折扣类别名称
        /// </summary>
        public string Oprbefdismc { get; set; }

        /// <summary>
        ///  变更后：折扣类别id
        /// </summary>
        public int Opraftdisid { get; set; }

        /// <summary>
        ///  变更后：折扣类别识别码
        /// </summary>
        public string Opraftdissbm { get; set; }

        /// <summary>
        ///  变更后：折扣类别名称
        /// </summary>
        public string Opraftdismc { get; set; }

        /// <summary>
        ///  操作记录：业务发生地点id(分支机构)
        /// </summary>
        public int Oprbrid { get; set; }

        /// <summary>
        ///  操作记录：业务发生地点名称(分支机构)
        /// </summary>
        public string Oprbrname { get; set; }

        /// <summary>
        ///  操作记录：业务执行人id(员工id)
        /// </summary>
        public int Oprid { get; set; }

        /// <summary>
        ///  操作记录：业务执行人名称
        /// </summary>
        public string Oprname { get; set; }


        /// <summary>
        ///  变更折扣后微信会员卡卡号(没有则为空)
        /// </summary>
        public string Membershipno { get; set; }


        /// <summary>
        ///  微信会员卡cardid(没有则为空)
        /// </summary>
        public string Wxcardid { get; set; }


        /// <summary>
        ///  微信会员卡code(没有则为空)
        /// </summary>
        public string Wxcardcode { get; set; }


        /// <summary>
        ///  操作记录：微信openid
        /// </summary>
        public string Accopenid { get; set; }

        /// <summary>
        ///  休眠密码（手机号+'|' +0~8位密码）
        /// </summary>
        public string Accsleeppwd { get; set; }


        public int AccKzid { get; set; }

        public string Acccellno { get; set; }

        public IMultiDbContext DbContext { get; set; }
        public string ConstrName { get; set; }
    }
    public class Cfv4AccStaChangeMapper : ClassMapper<AccStaChangeEach>
    {
        public Cfv4AccStaChangeMapper()
        {
            Table("#AccStaChanges");
            Map(f => f.Oprtime).Column("Oprtime");
            Map(f => f.Oprsno).Column("Oprsno");
            Map(f => f.Opraccid).Column("Opraccid");
            Map(f => f.Oprcardno).Column("Oprcardno");
            Map(f => f.Oprctype).Column("Oprctype");
            Map(f => f.Oprbefdisid).Column("Oprbefdisid");
            Map(f => f.Oprbefdissbm).Column("Oprbefdissbm");
            Map(f => f.Oprbefdismc).Column("Oprbefdismc");
            Map(f => f.Opraftdisid).Column("Opraftdisid");
            Map(f => f.Opraftdissbm).Column("Opraftdissbm");
            Map(f => f.Opraftdismc).Column("Opraftdismc");
            Map(f => f.Oprbrid).Column("Oprbrid");
            Map(f => f.Oprbrname).Column("Oprbrname");
            Map(f => f.Oprid).Column("Oprid");
            Map(f => f.Oprname).Column("Oprname");
            Map(f => f.Accopenid).Column("Accopenid");
            Map(f => f.Membershipno).Column("Membershipno");
            Map(f => f.Wxcardid).Column("Wxcardid");
            Map(f => f.Wxcardcode).Column("Wxcardcode");
            Map(f => f.AccKzid).Column("AccKzid");
            Map(f => f.Acccellno).Column("Acccellno");
            Map(f => f.Accsleeppwd).Column("Accsleeppwd");
        }

    }
}
